<?php
require_once '../sub/init.php';
if(@!in_array('gift',$navarr))zeaialert('{"title":"礼物商店已打烊","btnt":"我知道了","url":"-1"}');
if (!ifint($uid))zeaialert('{"title":"用户不存在","btnt":"我知道了","url":"-1"}');
require_once ZEAI.'sub/conn.php';
$jumpurl = a('{"kind":"u","uid":"'.$uid.'"}');
/*是否登录*/
if(!iflogin())header("Location: ".a('{"kind":"login"}').'?jumpurl='.$jumpurl);?>
<!doctype html><html><head><meta charset="utf-8">
<title>礼物商店-<?php echo $_ZEAI['siteName'];?></title>
<?php echo HEADMETA; ?>
<link href="<?php echo RES;?>m/css/m.css?<?php echo $_ZEAI['cache_str'];?>" rel="stylesheet" type="text/css" />
<link href="<?php echo RES;?>m/css/u.css?<?php echo $_ZEAI['cache_str'];?>" rel="stylesheet" type="text/css" />
<link href="<?php echo HOST;?>/cache/zeaicolor.css?<?php echo $_ZEAI['cache_str'];?>" rel="stylesheet" type="text/css" />
<script src="<?php echo RES;?>www_zeai_cn.js?<?php echo $_ZEAI['cache_str'];?>"></script>
<script src="<?php echo RES;?>m/js/m.js?<?php echo $_ZEAI['cache_str'];?>"></script>
<style>
#backtop a,.btmKefuBtn{background-color:<?php echo $_ZEAI['mob_mbcolor'];?>}
body{background-color:#fff}
.gift_index{background-color:#fff;padding:0;line-height:200%;font-size:1.8rem;margin-top:4.4rem}
.linebox{margin:2rem auto 5rem auto}
.topbg img{width:100%;display:block}
.gift_index ul{background:#fff;padding:1rem 0;clear:both;overflow:auto}
.gift_index ul li{width:33%;padding:1rem 0;float:left;text-align:center}
.gift_index ul li:hover h2{color:#f70}
.gift_index ul li p{width:7rem;height:7rem;line-height:7rem;margin:0 auto;text-align:center}
.gift_index ul li img{max-width:7rem;max-height:7rem;margin-top:-.3rem;vertical-align:middle}
.gift_index ul li h2{color:#666;font-size:1.4rem;color:#8d8d8d;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.gift_index ul li h4{line-height:1.2rem;font-size:1.2rem;color:#fd9f23}
.gift_index ul li h4 i{display:inline-block;width:1.5rem;height:1.5rem;line-height:1.5rem}
</style>
</head><body>
<?php
$mini_title='礼物商店';
require_once ZEAI.'m/top_mini.php';?>
<div class="gift_index">
    <div class="topbg"><img src="<?php echo RES;?>giftbg.png"></div>
    <div id="giflist">
    <?php 
    $rt=$db->query("SELECT id,title,price,picurl FROM ".__TBL_GIFT__." ORDER BY px DESC,id DESC");
    $total = $db->num_rows($rt);
    if ($total > 0) {
        echo '<ul>';
        for($i=1;$i<=$total;$i++) {
            $rows = $db->fetch_array($rt,'num');
            if(!$rows)break;
            $id     = $rows[0];
            $title  = dataIO($rows[1],'out');
            $price  = $rows[2];
            $picurl = UP.$rows[3];?>
            <li gid='<?php echo $id;?>'><p><img src="<?php echo $picurl; ?>"></p><h2><?php echo $title; ?></h2><h4><i class="ico">&#xe618;</i><?php echo $price; ?></h4></li><?php
            if ($i % 3 == 0){echo '</ul>';if ($i != $total)echo '<ul>';}
    }}else{echo "<div class='nodatatips'><i class='ico7'>&#xe608;</i>暂时木有上架礼物</div>";}?>
    </div>
	<div class="linebox"><div class="line W50"></div><div class="title BAI S12 C999">我是有底线的</div></div>
</div>
<div id='tips0_100_0' class='tips0_100_0 alpha0_100_0'></div>
<div id="box_gift_index" class="box_gift">
    <em><img><h3></h3><h6></h6></em>
    <a href="javascript:;">取消</a>
    <a href="javascript:;">确认赠送</a>
</div>
<div id="backtop"><a href="#top" id="btmTopBtn"><i class="ico">&#xe60c;</i>顶部</a></div>
<script src="<?php echo RES;?>m/js/u.js?<?php echo $_ZEAI['cache_str'];?>"></script>
<script>var uid=<?php echo $uid;?>,lovebstr='<?php echo $_ZEAI['loveB'];?>';gif_index(box_gift_index);
function gif_index(box){
	zeai.listEach(zeai.tag(giflist,'li'),function(li){
		li.onclick = function(){
			gift_ajaxdata(li.getAttribute("gid"),box_gift_index);
		}
	});
}
document.body.onscroll = backtop_alone;
</script>
</body></html>